//
//  THToolBase.h
//  THImageEditDemo
//
//  Created by 希达 on 2018/3/28.
//  Copyright © 2018年 Tan.huang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "UIImage+Utility.h"

#import "LxGridView.h"
#import "THBottomTool.h"
#import "THAddView.h"

#import "THImageEditViewController.h"

#import <YYKit/YYKit.h>
#import <TZImagePickerController/TZImagePickerController.h>

static const CGFloat kTHImageToolAnimationDuration = 0.3;

@interface THToolBase : NSObject

@property (nonatomic, weak) THImageEditViewController *editor;

@property (strong, nonatomic) LxGridView *collectionView;
@property (strong, nonatomic) NSMutableArray *imageArray;

/// edit 背景图
@property (strong, nonatomic) UIImage *bgImage;
/// 滤镜数组模型
@property (strong, nonatomic) NSMutableArray *filterArray;
@property (strong, nonatomic) GPUImagePicture *picture;


/// Add-ons功能中 添加文字和图片的容器
@property (strong, nonatomic) UIView *workingView;
/// 文字或图片的父类
@property (nonatomic, weak) THAddView *addView;
/// 工具条容器View
@property (strong, nonatomic) UIView *bgView;

- (id)initWithImageEditor:(THImageEditViewController *)editor;

- (void)setup;
- (void)cleanup;


/// 截取某个View
- (UIImage *)capture:(UIView *)view;
- (UIImage*)buildImage:(UIImage*)image;

/// 缩放动画
- (void)affineTransformScale:(UIView *)view toView:(UIView *)toView isShow:(BOOL)isShow;

//- (void)executeWithCompletionBlock:(void(^)(UIImage *image, NSError *error, NSDictionary *userInfo))completionBlock;

@end
